package com.baimifan.renovation.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.baimifan.renovation.publicfrag.DemoFragment;

/**
 * Created by sunyuanfei on 2017/7/7.
 */

public class DemoFragAdapter extends FragmentPagerAdapter {
    private String[] titles = {"推荐案例","最新发布","人气最高"};
    public DemoFragAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return DemoFragment.newInstance(position+1);
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
